package Game;

import java.awt.Graphics;
import java.util.ArrayList;


 public class ShotManagerGradius 
{
	static ArrayList<Ball> playerShot = new ArrayList<Ball>();
	static ArrayList<Ball> enemyShot = new ArrayList<Ball>();
	static float velocity = 20;
	static float enemyDELAY = 0;
	static float playerDELAY = 0;
	
	static public void Add(float x, float y, boolean isEnemy)
	{
		if(isEnemy == false)
		{
			if(playerDELAY >= 20)
			{
				playerShot.add(new Ball(x, y, 40, 30, velocity, 0));
				playerDELAY = 0;
			}
			else
				return;
		}
		else
		{
			if(enemyDELAY >= 50)
			{
				enemyShot.add(new Ball(x, y, 40, 30, velocity, 0));
				enemyDELAY = 0;
			}
			else
				return;
		}		
	}
	
	static public void Update()
	{
		for(Ball t : playerShot)
			t.Gradius();
		
		for(Ball t : enemyShot)
			t.GradiusEnemy();
		
		enemyDELAY ++;
		playerDELAY ++;
	}
	
	static public void Draw(Graphics g)
	{
		for(Ball t : playerShot)
			t.Draw(g);
		
		for(Ball t : enemyShot)
			t.Draw(g);
	}
	
}
